<!DOCTYPE html>
<!-- saved from url=(0022)http://localhost:8080/ -->
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta name="browsermode" content="application">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="Cache" content="no-cache">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <!-- 禁止百度转码 -->
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <!-- uc强制竖屏 -->
    <meta name="screen-orientation" content="portrait">
    <!-- QQ强制竖屏 -->
    <meta name="x5-orientation" content="portrait">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta name="format-detection" content="telephone=no">
    <title>地址管理</title>
    <link rel="stylesheet" href="${request.contextPath}/web/css/reset.css?v=${verison!}">
    <link rel="stylesheet" href="${request.contextPath}/web/css/base.css?v=${verison!}">
    <link rel="stylesheet" href="${request.contextPath}/web/css/address-manage.css?v=${verison!}">
    <link rel="stylesheet" href="${request.contextPath}/web/css/ydui.css">
    <link rel="stylesheet" href="${request.contextPath}/plug/layui/css/layui.css" media="all">
</head>
<body style="background-color: rgb(245, 245, 245);">
<div data-role="page">
    <div class="app">
        <div class="address-management router">
            <div class="line">
                <img src="${request.contextPath}/web/images/line.05bf1c84.jpg"></div>
            <#if data??>
                <#list data as item>
                    <div class="item">
                        <div class="address">
                            <div class="consignee">
                                收货人：${item.userName!}<span class="phone">${item.phone!}</span>
                            </div>
                            <div>
                                收货地址：${item.address!}
                            </div>
                        </div>
                        <div class="operation acea-row row-between-wrapper">
                            <div class="select-btn">
                                <div class="checkbox-wrapper">
                                    <label class="well-check">
                                        <input type="radio" name="radio" value="" <#if item.isDefault == 1>checked</#if> data-id="${item.id}">
                                        <i class="icon"></i>
                                        设为默认
                                    </label>
                                </div>
                            </div>
                            <div class="acea-row row-middle">
                                <div>
                                    <span class="iconfont icon-bianji" data-id="${item.id}"></span>编辑
                                </div>
                                <div><span class="iconfont icon-shanchu" data-id="${item.id}"></span>删除
                                </div>
                            </div>
                        </div>
                    </div>
                </#list>
            </#if>
            <#if data?size==0>
                <div class="noCommodity"><div data-v-5f9f2230="" class="noPictrue"><img  src="${request.contextPath}/web/images/noAddress.png" class="image"></div></div>
            </#if>
            <div style="height: 1.2rem;"></div>
            <div class="footer acea-row row-between-wrapper">
                <a class="addressBnt on bg-color-red" href="${request.contextPath}/web/addressAdd">
                    <!--<span class="iconfont icon-tianjiadizhi"></span>-->添加新地址
                </a>
            </div>
        </div>
    </div>
    <#include "include/right.html" />
</div>
</body>
<script type="text/javascript" src="${request.contextPath}/web/js/media_750.js"></script>
<script type="text/javascript" src="${request.contextPath}/web/js/jquery.min.js"></script>
<script type="text/javascript" src="${request.contextPath}/web/js/jquery.mobile.min.js"></script>
<script type="text/javascript" src="${request.contextPath}/web/js/ydui.js"></script>
<script type="text/javascript" src="${request.contextPath}/web/js/common.js"></script>
<script src="${request.contextPath}/js/layer.js"></script>
<script>
    $(function(){
        $(".icon-bianji").parent().on('click',function(){
             window.location.href="${request.contextPath}/web/addressAdd?id="+$(this).find("span").data("id")
        });
        $(".icon-shanchu").parent().on('click',function(){
            $.ajax({
                  type: 'POST',
                  url: '${request.contextPath}/web/address/delete/' + $(this).find("span").data("id"),
                  dataType:'json',
                  contentType:'application/json',
                  success: function(data){
                      if(data.code==200){
                         window.location.href="${request.contextPath}/web/addressList"
                      }else{
                         layer.msg(data.msg)
                      }
                  }
            });
        });
        $("input[name='radio']").on('click',function(){
            var isDefault = $(this).prop("checked") ? 1 : 0;
            $.ajax({
                  type: 'POST',
                  url: '${request.contextPath}/web/address/updateIsDefault/' + $(this).data("id") + '/' + isDefault,
                  dataType:'json',
                  contentType:'application/json',
                  success: function(data){
                     layer.msg(data.msg)
                  }
            });
        });
    });
</script>
</html>